package com.gjintel.framework.dataset.service.impl;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.gjintel.framework.dataset.dao.IDataSetDao;
import com.gjintel.framework.dataset.model.DataSet;
import com.gjintel.framework.dataset.service.IDataSetService;
import com.gjintel.sdk.base.service.impl.BaseServiceImpl;
import com.gjintel.sdk.util.StringUtil;

@Service("dataSetService")
public class DataSetServiceImpl extends BaseServiceImpl implements IDataSetService {
	@Autowired
	private IDataSetDao dataSetDao;

	@Override
	public DataSet getDataSet() {
		return this.dataSetDao.getDataSet();
	}

	@SuppressWarnings("unchecked")
	@Override
	public void saveDataSet(DataSet dataSet) {
		if (StringUtil.isEmpty(dataSet.getId())) {
			dataSet.setId(null);
		} 
		this.saveOrUpdate(dataSet);
	}

}
